package chapter22;

import java.util.Comparator;
import java.io.Serializable;
import chapter14.GeometricObject;

public class GeometricObjectComparator
	implements Comparator<GeometricObject>, Serializable{
	public int compare(GeometricObject o1, GeometricObject o2){
		double area1 = o1.getArea();
		double area2 = o2.getArea();
		
		if (area1 < area2)
			return -1;
		else if (area1 > area2)
			return 1;
		else
			return 0;
	}

}
